package com.huanyang.controller;

import com.huanyang.common.Result;
import com.huanyang.exception.CommonException;
import com.huanyang.pojo.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @RequestMapping("/register")
    public Result register(@RequestBody @Validated User user) {
        if (!user.getUserPwd().equals(user.getConfirmPwd())) {
            throw new CommonException(4001, "确认密码和密码不一致，请确认");
        }
        // 业务处理...
        return Result.success(200, "注册成功");
    }
}
